/*
 *  Copyright 2020-2025 the original author or authors.
 *  You cannot use this file unless authorized by the author.
 */

package org.ipig.search.es.result;

import lombok.Data;
import org.elasticsearch.action.search.ShardSearchFailure;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.profile.ProfileShardResult;
import org.elasticsearch.search.suggest.Suggest;

import java.io.Serializable;
import java.util.Map;

/**
 * 检索结果
 * <li>包括匹配结果、聚合结果、Suggest等
 *
 * @author <a href="mailto:comchnts@163.com">chinats</a>
 * @version $$Id$$
 * @since 1.0
 */
@Data
public class SearchResult implements Serializable {
    /** 检索匹配记录 */
    private SearchHits searchHits;
    /** 聚合结果 */
    private Aggregations aggs;
    /** Suggest结果 */
    private Suggest suggest;
    /** ProfileShardResult */
    Map<String, ProfileShardResult> shardProfileMap;
    /** 检索失败的分片数组 */
    ShardSearchFailure[] shardFailuresArray;
}